package com.yuba.front.domain.bo;

import com.yuba.front.domain.FrontMessage;
import com.yuba.common.mybatis.core.domain.BaseEntity;
import com.yuba.common.core.validate.AddGroup;
import com.yuba.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

/**
 * 用户消息通知业务对象 front_message
 *
 * @author modakai
 * @date 2024-12-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = FrontMessage.class, reverseConvertGenerate = false)
public class FrontMessageBo extends BaseEntity {

    /**
     * 通知ID
     */
    @NotNull(message = "通知ID不能为空", groups = { EditGroup.class })
    private Long messageId;

    /**
     * 接收通知的用户
     */
    @NotNull(message = "接收通知的用户不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userId;

    /**
     * 发送通知的用户
     */
    @NotNull(message = "发送通知的用户不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long senderId;

    /**
     * 通知类型
     */
    @NotBlank(message = "通知类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String type;

    /**
     * 消息来源ID，例如帖子ID或评论ID
     */
    @NotNull(message = "消息来源ID，例如帖子ID或评论ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long sourceId;

    /**
     * 消息跳转时的参数
     */
    @NotBlank(message = "消息跳转时的参数不能为空", groups = { AddGroup.class, EditGroup.class })
    private String meta;

    /**
     * 通知内容
     */
    @NotBlank(message = "通知内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String value;

    /**
     * 是否已读
     */
    @NotBlank(message = "是否已读不能为空", groups = { AddGroup.class, EditGroup.class })
    private String readFlag;


}
